﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Serialization;
using System.IO;

namespace SimTank
{
    public partial class SimTankMainWindow : Form
    {
        List<attackQueueObject> attackList;
        static public Hashtable spellNameHash;

        void PopulateHashtable()
        {
            spellNameHash = new Hashtable();
            List<SpellHash> HashList = new List<SpellHash>();
            TextReader infile = new StreamReader(@"SpellHashtable.xml");
            XmlSerializer s = new XmlSerializer(typeof(List<SpellHash>));
            HashList = (List<SpellHash>)s.Deserialize(infile);

            foreach (SpellHash data in HashList)
            {
                spellNameHash.Add(data.id, data.name);
            }
            attackQueueObject.spellNameHash = spellNameHash;
        }

        void PopulateAbilityList()
        {
            attackList = new List<attackQueueObject>();
            TextReader infile = new StreamReader(@"SpellConditions.xml");
            XmlSerializer s = new XmlSerializer(typeof(List<attackQueueObject>));
            attackList = (List<attackQueueObject>)s.Deserialize(infile);
        }
    }

    [XmlRoot("SpellHash")]
    public class SpellHash
    {
        [XmlElement("Name")]
        public String name;
        [XmlElement("Id")]
        public int id;
    }
}